/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.ginet.abstractginet.impl;

import org.eclipse.emf.ecore.EClass;
import org.pnml.tools.epnk.pnmlcoremodel.PetriNetType;

import ar.edu.utn.frsf.cidisi.ginet.abstractginet.AbstractGINetType;
import ar.edu.utn.frsf.cidisi.ginet.abstractginet.AbstractginetFactory;
import ar.edu.utn.frsf.cidisi.ginet.abstractginet.AbstractginetPackage;
import ar.edu.utn.frsf.cidisi.ginet.impl.GINetTypeImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Abstract GI Net Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * </p>
 *
 * @generated
 */
public class AbstractGINetTypeImpl extends GINetTypeImpl implements AbstractGINetType {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public AbstractGINetTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return AbstractginetPackage.Literals.ABSTRACT_GI_NET_TYPE;
	}

	@Override
	public String toString() {
		return "org.pnml.tools.epnk.pntypes.abstractginet";
	}

	/**
	 * A null pointer exception occurs if this method is not overridden.- 
	 * 
	 * @generated NOT
	 * @author jmr
	 */
	@Override
	public AbstractGINetType createPetriNetType() {
		return AbstractginetFactory.eINSTANCE.createAbstractGINetType();
	}
	
	/**
	 * A null pointer exception occurs if this method is not overridden.- 
	 * 
	 * @generated NOT
	 * @author jmr
	 */
	@Override
	public PetriNetType createPetriNetType(String type) {
		// Checking this condition is important to avoid confusing abstract gin-nets with concrete gi-nets.-
		// The string received in the type parameter is the ID defined in the extension mechanism of the plugin.xml 
		// e.g. org.pnml.tools.epnk.pntypes.ptnet. This type is compared to the string defined in the toString() 
		// method. Therefore, it is important that Petri Net Type (in this case AbstractGINetType) ID be equal to
		// the string returned in the toString method of the Petri Net Type class (in this case AbstractGINetTypeImpl)
		if (type.equals(this.toString())) {
			return createPetriNetType();
		}
		return null;
		
	}

} //AbstractGINetTypeImpl
